package com.example.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.example.pojo.plcAlarmSettingPojo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface plcAlarmSettingMapp {
    @DS("newMscLowCodeFormal")
    //定义SQL语句，查询数据库中的所有数据
    @Select("select * from PLC_ALARM_SETTING")
    List<plcAlarmSettingPojo> selectAll();
    //在报警信息基础数据表中根据ID号修改一条数据
    @DS("newMscLowCodeFormal")
    @Update("update PLC_ALARM_SETTING set workShop=#{workShop},workArea=#{workArea}," +
            "stationID=#{stationID}, plcIPaddress=#{plcIPaddress},dbBlock=#{dbBlock},dbByte=#{dbByte},dbBit=#{dbBit}," +
            "partNumberDB=#{partNumberDB}, alarmCode=#{alarmCode},alarmInformationChinese=#{alarmInformationChinese}," +
            "alarmInformationRussian=#{alarmInformationRussian},alarmInformationEnglish=#{alarmInformationEnglish}," +
            "alarmLevel=#{alarmLevel} where id=#{id}" )
    void editOneById(plcAlarmSettingPojo pojo);
}
